<?php
/**
 * Created by PhpStorm.
 * User: RagPanda
 * Date: 2016/3/9
 * Time: 15:21
 */

namespace App\Http\Controllers\Admin;


use App\Http\Controllers\Controller;
use MyClass\Base\GuiFunction;
use MyClass\Serve\Payment;

class PaymentController extends Controller
{
    public function __construct(GuiFunction $guiFunc)
    {
        $guiFunc->setModule("Manage");
    }

    public function sPayment()
    {
        //return view("Admin.Manage.sPayment");
        //$queryLimit['start'] = 0;
        //$queryLimit['num'] = 5;
        $queryLimit['class'] = 1;
        //$queryLimit['paginate'] = 3;
        //$queryLimit['desc'] = true;

        $data = Payment::select($queryLimit);
        dump($data);
    }

    public function aPayment()
    {
        //return view("Admin.Manage.sPayment");
        $dataArray['payment_user_data'] = "wyf";
        $dataArray['payment_class'] = 3;
        if(Payment::add($dataArray))
        {
            echo "cg";
        }
        else
        {
            echo "sb";
        }
    }
    public function uPayment()
    {
        $payment = new Payment(1);
        $dataArray['payment_user_data'] = "wyfssb";
        if($payment->update($dataArray))
        {
            echo "cg";
        }
        else
        {
            echo "sb";
        }
    }
    public function dPayment()
    {
        $payment = new Payment(1);
        if($payment->delete())
        {
            echo "cg";
        }
        else
        {
            echo "sb";
        }
    }
}